#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
using namespace std;
using i64=long long;
//1.integer overflow (1e5 * 1e5) (2e9 + 2e9)
//2.runtime error
//3.boundary condition
i64 check(vector<int> &a)
{
	sort(all(a));

	i64 ret = 0;
	int n = a.size();
	for(int i = 1; i < n; i++)
	{
		ret += 1LL * i * (n - i) * (a[i] - a[i - 1]);
	}
	return ret;
}
void solve()
{
    int n;
    cin >> n;

    vector<int> xs[2], ys[2];
    for(int i = 0; i < n; i++)
    {
    	int x, y;
    	cin >> x >> y;
    	int t = (x + y) % 2;
    	xs[t].emplace_back(x + y);
    	ys[t].emplace_back(x - y);
    }

    i64 ans = check(xs[0]) + check(xs[1]) + check(ys[0]) + check(ys[1]);
    ans /= 2;
    cout << ans;
}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(10);
    cout<<fixed;
    int t=1;
    //cin>>t;
    while(t--)
    {
        solve();
    }
#ifdef LOCAL_DEFINE
    freopen("input.txt", "r", stdin);
#endif
    
#ifdef LOCAL_DEFINE
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
    return 0;
}
